<?php
$html = 'nihao <a href="p.php">test</a><img src="htttp://c.com">sdfdsfsfdsfdssfs';
$pattern_src = '/<img[\s\S]*?src\s*=\s*[\"|\'](.*?)[\"|\'][\s\S]*?>/';

$s = preg_replace_callback($pattern_src, function ($item) {
    return '';
}, $html);
echo $s;
?>
